﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports ExtensionLibrary

''' <summary>
''' Tests the methods within the <see cref="IntegerExtensions">IntegerExtensions</see> class.
''' </summary>
''' <revisions>
'''   <revision date="11/02/2008" author="Chad Green" version="1.0.0.0">Initial Development</revision>
''' </revisions>
<TestClass()> Public Class IntegerExtensionsTest

  Private testContextInstance As TestContext

  ''' <summary>
  ''' Gets or sets the test context which provides information about and functionality for the current test run.
  ''' </summary>
  ''' <value>The test context.</value>
  ''' <revisions>
  '''   <revision date="11/02/2008" author="Chad Green" version="1.00.000">Initial Development</revision>
  ''' </revisions>
  Public Property TestContext() As TestContext
    Get
      Return testContextInstance
    End Get
    Set(ByVal value As TestContext)
      testContextInstance = value
    End Set
  End Property

  ''' <summary>
  ''' Tests the <see cref="IntegerExtensions.ContentLength">ContentLength</see> method specyfing a value that falls in the byte range.
  ''' </summary>
  ''' <revisions>
  '''   <revision date="11/02/2008" author="Chad Green" version="1.0.0.0">Initial Development</revision>
  ''' </revisions>
  <TestMethod()> Public Sub ContentLengthTest1()
    Dim intInput As Integer = 100
    Assert.AreEqual("100 bytes", intInput.ContentLength)
  End Sub

  ''' <summary>
  ''' Tests the <see cref="IntegerExtensions.ContentLength">ContentLength</see> method specyfing a value that falls in the kilobyte range.
  ''' </summary>
  ''' <revisions>
  '''   <revision date="11/02/2008" author="Chad Green" version="1.0.0.0">Initial Development</revision>
  ''' </revisions>
  <TestMethod()> Public Sub ContentLengthTest2()
    Dim intInput As Integer = 1025
    Assert.AreEqual("1.00 KB", intInput.ContentLength)
  End Sub

  ''' <summary>
  ''' Tests the <see cref="IntegerExtensions.ContentLength">ContentLength</see> method specyfing a value that falls in the megabyte range.
  ''' </summary>
  ''' <revisions>
  '''   <revision date="11/02/2008" author="Chad Green" version="1.0.0.0">Initial Development</revision>
  ''' </revisions>
  <TestMethod()> Public Sub ContentLengthTest3()
    Dim intInput As Integer = 1048576
    Assert.AreEqual("1.00 MB", intInput.ContentLength)
  End Sub

  ''' <summary>
  ''' Tests the <see cref="IntegerExtensions.ContentLength">ContentLength</see> method specyfing a value that falls in the gigabyte range.
  ''' </summary>
  ''' <revisions>
  '''   <revision date="11/02/2008" author="Chad Green" version="1.0.0.0">Initial Development</revision>
  ''' </revisions>
  <TestMethod()> Public Sub ContentLengthTest4()
    Dim intInput As Integer = 1073741825
    Assert.AreEqual("1.00 GB", intInput.ContentLength)
  End Sub


End Class